﻿using Shop.RemoteModel.Shop.Model;
using Shop.StoreGatewayModular.Interface;
using WeDonekRpc.Helper.Validate;
using WeDonekRpc.HttpApiGateway;
namespace Shop.StoreGatewayModular.Api
{
    /// <summary>
    /// 门店资料管理
    /// </summary>
    internal class ShopApi : ApiController
    {
        private readonly IShopService _Service;
        public ShopApi (IShopService service)
        {
            this._Service = service;
        }
        /// <summary>
        /// 获取门店资料
        /// </summary>
        /// <returns></returns>
        public ShopDatum Get ()
        {
            return this._Service.Get(base.UserState);
        }
        /// <summary>
        /// 门店登陆
        /// </summary>
        /// <param name="companyId"></param>
        public long Login ([NumValidate("hr.company.id.error", 1)] long companyId)
        {
            return this._Service.Login(base.UserState, companyId);
        }

        /// <summary>
        /// 修改门店资料
        /// </summary>
        /// <param name="datum"></param>
        public bool Set (ShopSetArg datum)
        {
            return this._Service.Set(base.UserState, datum);
        }
    }
}
